﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace FDEE.Model
{
    class CPM1 : CPMBase
    {
        List<int> lst = new List<int>() {953,964,981,1004,1034,1069,1108,1153,1201,1220 };
        List<int> lstA = new List<int>() { 876, 886, 902, 923, 950, 982, 1019, 1060, 1104, 1121 };
        List<int> lstB = new List<int>() { 243, 246, 250, 256, 263, 272, 282, 294, 306, 311 };
        Dictionary<string, int[]> dicRInfo = new Dictionary<string, int[]>();
        public CPM1(string typeName, string pierNumber, eColumnType ct, eSubType st, int ww, int ll, int midww, int tww, int tmidww, int pierHeight, int rr, int dia, double up, double low, double topL, double lowL, eDB mainDB, double wwside, double llside) :
            base(typeName, pierNumber, ct, st, ww, ll, midww, tww, tmidww, pierHeight, up, low, topL, lowL, rr, dia, mainDB, wwside, llside)
        {
            dicRInfo = new Dictionary<string, int[]>();
            switch (st)
            {
                case eSubType.B:
               
                    dicRInfo.Add("13.1.a", new int[] { 8078, 6050, 140, 18 });
                    dicRInfo.Add("13.2.a", new int[] { 8972, 5920, 1114, 6 });
                    dicRInfo.Add("13.3.a", new int[] { 8708, 5953, 809, 4 });
                    dicRInfo.Add("13.3.b", new int[] { 8498, 5982, 605, 4 });
                    dicRInfo.Add("13.3.c", new int[] { 8288, 6014, 402, 4 });
                    dicRInfo.Add("13.4.a", new int[] { 8078, 6050, 140, 4 });
                    dicRInfo.Add("13.5.a", new int[] { 8906, 5928, 1114, 4 });
                    dicRInfo.Add("14.1.a", new int[] { 8110, 6044, 140, 10 });
                    dicRInfo.Add("14.2.a", new int[] { 8940, 5924, 1114, 8 });
                    dicRInfo.Add("14.2.b", new int[] { 8940, 5924, 1114, 14 });
                    dicRInfo.Add("14.3.a", new int[] { 8874, 5932, 911, 4 });
                    dicRInfo.Add("14.3.b", new int[] { 8813, 5940, 911, 8 });
                    dicRInfo.Add("14.3.c", new int[] { 8603, 5967, 707, 4 });
                    dicRInfo.Add("14.4.a", new int[] { 8110, 6044, 140, 4 });
                    dicRInfo.Add("14.5.a", new int[] { 8935, 5925, 1114, 4 });
                    dicRInfo.Add("14.5.b", new int[] { 8903, 5929, 1114, 4 });
                    break;
                case eSubType.C:
                    dicRInfo.Add("13.1.a", new int[] { 8068, 6052, 140, 14 });
                    dicRInfo.Add("13.2.a", new int[] { 8982, 5919, 1286, 6 });
                    dicRInfo.Add("13.3.a", new int[] { 8809, 5940, 955, 4 });
                    dicRInfo.Add("13.3.b", new int[] { 8597, 5968, 649, 4 });
                    dicRInfo.Add("13.3.c", new int[] { 8491, 5983, 547, 4 });
                    dicRInfo.Add("13.3.d", new int[] { 8386, 5999, 445, 4 });
                    dicRInfo.Add("13.3.e", new int[] { 8174, 6033, 242, 4 });
                    dicRInfo.Add("13.4.a", new int[] { 8086, 6052, 140, 4 });
                    dicRInfo.Add("13.5.a", new int[] { 8914, 5927, 955, 4 });
                    dicRInfo.Add("14.1.a", new int[] { 8108, 6045, 140, 10 });
                    dicRInfo.Add("14.2.a", new int[] { 8932, 5925, 1286, 8 });
                    dicRInfo.Add("14.2.b", new int[] { 8932, 5925, 1286, 14 });
                    dicRInfo.Add("14.3.a", new int[] { 8861, 5934, 955, 4 });
                    dicRInfo.Add("14.3.b", new int[] { 8703, 5954, 955, 8 });
                    dicRInfo.Add("14.3.c", new int[] { 8280, 6015, 955, 4 });
                    dicRInfo.Add("14.4.a", new int[] { 8108, 6045, 140, 4 });
                    dicRInfo.Add("14.5.a", new int[] { 8935, 5822, 1286, 4 });
                    dicRInfo.Add("14.5.b", new int[] { 8908, 5928, 955, 4 });
                    break;
            }
        }

        public override void SetRebarDistribute()
        {
            //throw new NotImplementedException();
        }

        public override void SetRebarList()
        {
            switch (SubType)
            {
                case eSubType.B:
                    SetBRebarList();
                    break;
                case eSubType.C:
                    SetCRebarList();
                    break;
            }
        }

        public  void SetBRebarList()
        {
            #region 箍筋
            int npts =1;
            int count = 11;
            int ini1A = 0;
            int ini2B = 0;
            int ini3A = 0;
           
            List<double> lst1A = new List<double>();
            double w0 =0, l0=0;
            CalAngelLength(ref w0, ref l0);
            int wside = (int)Math.Round(w0,0);
            int lside = (int)Math.Round(l0, 0);
            int capN2 = (int)(((Width - MidWidth) * 0.5 - wwSide -50-32*2) / 8);
            int capN3 = (int)Math.Round(((Length - 50 * 2-32*2+12) / 10.0),0);
            int a=0;
            int b=0;
            int c=0;
            int d=0;
            //1#
 
            double r1 = 0;
            double r0 = 0;
            double x = 0;
            double y = 0;
            double xI = 0;
            double yI = 0;

         
            a =(int)((Width - MidWidth) * 0.5-50 - wwSide - wside);
            ini1A = a;
            b = (int)(Length- 50*2);
            c = (int)Math.Sqrt(Math.Pow(wwSide, 2) + Math.Pow(llSide, 2)) - wside - lside;
            d= (int)(Length - llSide*2-lside*2);
            npts = GetTopStirrupNum()*2;
            RebarList.Add(new MRCRebarRecord(1, 0, "", eDB.DB12, npts, eShapeType.MRC, a, b, c,d));

            CalArcCenter(Width * 0.5, LenUpper-32*10, TopWidth * 0.5, LenUpper, Radius, LenUpper, ref r1, ref x, ref y);
            CalArcCenter( MidWidth * 0.5, LenUpper - 32 * 10, TopMidWidth * 0.5, LenUpper, Radius, LenUpper, ref r0, ref xI, ref yI);
            for (int m = 1; m < count; m++)
            {
                string no = "A";
                //byte[] array = new byte[1];   //定义一组数组array
                //array = System.Text.Encoding.ASCII.GetBytes(no); //string转换的字母
                //int asciicode = (short)(array[0]);
                byte[] array = new byte[1];
                array[0] = (byte)(Convert.ToInt32(64+m)); //ASCII码强制转换二进制
                no = Convert.ToString(System.Text.Encoding.ASCII.GetString(array));
                int a1 =(int)(Math.Round( Math.Sqrt(Math.Pow(m * 100 - 25 * m, 2)+Math.Pow(ini1A, 2)),0));
                //if (m == 10)
                //    a1 = 1121;
                RebarList.Add(new MRCRebarRecord(1, 0, no, eDB.DB12, 1 * 2, eShapeType.MRC, a1, b, c, d));
                lst1A.Add(a1);
                //double h0 = LenUpper - 32 * 10 + 32 * m;
                //double w = GetXByH(x , y , h0, Radius) ;
                //double wwS = GetX2ByH(xI, yI , h0, Radius)- GetXByH(x, y, h0, Radius);
            }
            int a2 = (int)(Length - 50 * 2-12*2);
            int b2 = (int)MainRebarDB + capN2 * 2;
            ini2B = b2;
            //2#
            RebarList.Add(new MORebarRecord(2, 0, "", eDB.DB12, npts*2, eShapeType.MO, a2, b2));
            for (int m = 1; m <count; m++)
            {
                string no = "A";
                byte[] array = new byte[1];
                array[0] = (byte)(Convert.ToInt32(64 + m)); //ASCII码强制转换二进制
                no = Convert.ToString(System.Text.Encoding.ASCII.GetString(array));
                int bb2 = (int)(Math.Round((lst1A[m - 1] / ini1A) * ini2B,0));
                RebarList.Add(new MORebarRecord(2, 0, no, eDB.DB12, 2 * 2, eShapeType.MO, a2, bb2));

            }

            int a3 = (int)((Width - MidWidth) * 0.5)-50*2 - 12 * 2;
            int b3 = (int)MainRebarDB + capN3 * 2;
            ini3A = a3;
            //3#
            RebarList.Add(new MORebarRecord(3, 0, "", eDB.DB12, npts*2, eShapeType.MO,a3, b3));
            for (int m = 1; m < count; m++)
            {
                string no = "A";
                byte[] array = new byte[1];
                array[0] = (byte)(Convert.ToInt32(64 + m)); //ASCII码强制转换二进制
                no = Convert.ToString(System.Text.Encoding.ASCII.GetString(array));
                int aa3 = (int)(Math.Round((lst1A[m - 1] / ini1A) * ini3A,0));
                RebarList.Add(new MORebarRecord(3, 0, no, eDB.DB12, 2 * 2, eShapeType.MO, aa3, b3));

            }

            int h = 155;
            int a4 = (int)((Width - MidWidth) * 0.5) - 50 * 2;
            //4#
            RebarList.Add(new MDRRebarRecord(4, 0, "", eDB.DB12, npts, eShapeType.MDR, a4, h));
            for (int m = 1; m < count; m++)
            {
                string no = "A";
                byte[] array = new byte[1];
                array[0] = (byte)(Convert.ToInt32(64 + m)); //ASCII码强制转换二进制
                no = Convert.ToString(System.Text.Encoding.ASCII.GetString(array));
                int aa4 = (int)(Math.Round((lst1A[m - 1] / ini1A) * a4,0));
                RebarList.Add(new MDRRebarRecord(4, 0, no, eDB.DB12, 1 * 2, eShapeType.MDR,aa4, h));

            }
            int nptsM = GetLowStirrupNum() * 2;
            RebarList.Add(new MRCRebarRecord(6, 0, "", eDB.DB12, nptsM, eShapeType.MRC, a, b, c, d));

            int a7 = (int)(Length - 50 * 2 - 12 * 2);
            int b7 =4*capN2+ (int)MainRebarDB;
            //7#
            RebarList.Add(new MORebarRecord(7, 0, "", eDB.DB12, nptsM, eShapeType.MO, a7, b7));

            int a8 = Width - 50 * 2-2*12; ;
            int b8 = 2 * capN3 + (int)MainRebarDB;
            //8#
            RebarList.Add(new MORebarRecord(8, 0, "", eDB.DB12, nptsM, eShapeType.MO, a8, b8));

            RebarList.Add(new MCORebarRecord(8, 1, "", eDB.DB12, 2, eShapeType.MCO, 2407, b8,927,189,183));
            RebarList.Add(new MCORebarRecord(8, 2, "", eDB.DB12, 2, eShapeType.MCO, 2436, b8, 943, 208, 180));
            RebarList.Add(new MCORebarRecord(8, 3, "", eDB.DB12, 2, eShapeType.MCO, 2488, b8, 970, 241, 177));
            int a9 =6*capN3 + (int)MainRebarDB;
            int b9 = 180 + (int)MainRebarDB;
            //9#
            RebarList.Add(new MORebarRecord(9, 0, "", eDB.DB12, nptsM, eShapeType.MO, a9, b9));

            RebarList.Add(new MCCRebarRecord(9, 1, "", eDB.DB12, 606,b9,2, eShapeType.MCC));
            RebarList.Add(new MCCRebarRecord(9, 2, "", eDB.DB12, 456, b9, 2, eShapeType.MCC));
            RebarList.Add(new MCCRebarRecord(9, 3, "", eDB.DB12, 306, b9, 2, eShapeType.MCC));
            int a10 = Length  - 50 * 2;
            //10#
            RebarList.Add(new MDRRebarRecord(10, 0, "", eDB.DB12, npts, eShapeType.MDR, a10, h));
            #endregion

            #region 主筋
            int NumMainAll = 4 + 2 + 9 * 2 + 3 * 2 + 6 * 2 + 2 * 2 + 2 * 2;
            //12 中间
            RebarList.Add(new MHXRebarRecord(12, 0, "", MainRebarDB, true,4, eShapeType.MHX,(count-1)*1000));
            double arcb = RebarList[RebarList.Count - 1].B;
            double arcN = RebarList[RebarList.Count - 1].C;
            RebarList.Add(new MRLCRebarRecord(12, 0, "B", eDB.DB12, 2, eShapeType.MRLC, 4532, 975,194,589));
            //13中间
            RebarList.Add(new MHXRebarRecord(13, 1, "", MainRebarDB, true, 9*2, eShapeType.MHX, (count - 1) * 1000)); //侧
            RebarList.Add(new MHXRebarRecord(13, 2, "", MainRebarDB, true, 14*2, eShapeType.MHX, (count - 1) * 1000)); //上下
            RebarList.Add(new MHXRebarRecord(13, 3, "", MainRebarDB, true, 6*2, eShapeType.MHX, (count - 1) * 1000));   //中间
            RebarList.Add(new MHXRebarRecord(13, 4, "", MainRebarDB, true, 2*2, eShapeType.MHX, (count - 1) * 1000));   //侧角
            //RebarList.Add(new MHXRebarRecord(13, 5, "", MainRebarDB, true, 2*2, eShapeType.MHX, (count - 1) * 1000));   //中间角


            //  1-获取承台尺寸
            FootingBase theFooting = MemberFactory.CreatMember(MemberFactory.FromColumnToFooting(ColumnType), SubType);
            int FTHeight = theFooting.Height;
            double LConst = PierHeight - LenUpper;
            int[] value = dicRInfo.Values.ToList()[0];
            int arcR = value[0];
            int arcLength = value[1];
            int arcC = value[2];
            int arcNum = value[3];
            int A = 600;        //固定      
            int C = 45;         //固定
            C = 250;
            int D = 2400;       //固定
            int len = 9000;
            int L = len;       //固定
            int r = RebarKnowledge.GerRadius(MainRebarDB);
            int d0 = 32;
            int B = L - A - C - D + r / 2 + d0;
            int aa = (int)Math.Round(LConst + FTHeight - 160 - B - 32, 0, MidpointRounding.AwayFromZero);
            if (C == 250)
                aa = (int)Math.Round(LConst + FTHeight - 160 - B - 248, 0, MidpointRounding.AwayFromZero);
            int bb = arcLength;// (int)Math.Round(arc.Length, 0, MidpointRounding.AwayFromZero);
            int cc = arcC;// 305;
            int dd = 1500 - arcC;// 1195;
            if (MainRebarDB == eDB.DB28)
                dd = 1200 - arcC;
            int rr = arcR;// (int)Math.Round(arc.Radius, 0, MidpointRounding.AwayFromZero);
            foreach (var item in dicRInfo.Keys)
            {
                value = dicRInfo[item];
                int arcr = value[0];
                bb = value[1];
                cc = value[2];
                int arcnum = value[3];
                dd = 1400 - cc;
               
                rr = arcr;
                string[] va = item.Split('.');

                if (int.Parse(va[0]) == 14)
                    aa = 800;
                if (va.Length == 1)
                    RebarList.Add(new MKRebarRecord(int.Parse(va[0]), 0, "", MainRebarDB, arcnum, eShapeType.MK, aa, bb, cc, dd, rr));
                else if (va.Length == 2)
                    RebarList.Add(new MKRebarRecord(int.Parse(va[0]), int.Parse(va[1]), "", MainRebarDB, arcnum, eShapeType.MK, aa, bb, cc, dd, rr));
                else if (va.Length == 3)
                    RebarList.Add(new MKRebarRecord(int.Parse(va[0]), int.Parse(va[1]), va[2], MainRebarDB, arcnum, eShapeType.MK, aa, bb, cc, dd, rr));

            }

            RebarList.Add(new MANRebarRecord(15,1,"", MainRebarDB, 1923, 600,2,eShapeType.MAN));
            RebarList.Add(new MANRebarRecord(15, 2, "", MainRebarDB, 2051, 600, 2, eShapeType.MAN));
            RebarList.Add(new MANRebarRecord(15, 3, "", MainRebarDB, 2179, 600, 2, eShapeType.MAN));
            #endregion
            //if (isDiv)
            //    UAN1N2 = NumMainAll * 8;
            //else
                UAN1N2 = NumMainAll * 4;
        }


        public void SetCRebarList()
        {
            #region 箍筋
            int npts = 1;
            int count = 11;
            int ini1A = 0;
            int ini2B = 0;
            int ini3A = 0;
            List<double> lst1A = new List<double>();
            double w0 = 0, l0 = 0;
            CalAngelLength(ref w0, ref l0);
            int wside = (int)Math.Round(w0, 0);
            int lside = (int)Math.Round(l0, 0);
            int a = 0;
            int b = 0;
            int c = 0;
            int d = 0;
            //1#

            double r1 = 0;
            double r0 = 0;
            double x = 0;
            double y = 0;
            double xI = 0;
            double yI = 0;


            a = (int)((Width - MidWidth) * 0.5 - 50 - wwSide - wside);
            ini1A = a;
            b = (int)(Length - 50 * 2);
            c = (int)Math.Sqrt(Math.Pow(wwSide, 2) + Math.Pow(llSide, 2)) - wside - lside;
            d = (int)(Length - llSide * 2 - lside * 2);
            npts = GetTopStirrupNum() * 2;
            RebarList.Add(new MRCRebarRecord(1, 0, "", eDB.DB12, npts, eShapeType.MRC, a, b, c, d));

            CalArcCenter(Width * 0.5, LenUpper - 32 * 10, TopWidth * 0.5, LenUpper, Radius, LenUpper, ref r1, ref x, ref y);
            CalArcCenter(MidWidth * 0.5, LenUpper - 32 * 10, TopMidWidth * 0.5, LenUpper, Radius, LenUpper, ref r0, ref xI, ref yI);
            for (int m = 1; m < count; m++)
            {
                string no = "A";
                //byte[] array = new byte[1];   //定义一组数组array
                //array = System.Text.Encoding.ASCII.GetBytes(no); //string转换的字母
                //int asciicode = (short)(array[0]);
                byte[] array = new byte[1];
                array[0] = (byte)(Convert.ToInt32(64 + m)); //ASCII码强制转换二进制
                no = Convert.ToString(System.Text.Encoding.ASCII.GetString(array));
                int a1 = (int)(Math.Round(Math.Sqrt(Math.Pow(m * 100 - 25 * m, 2) + Math.Pow(ini1A, 2)), 0));
                if (m == 10)
                    a1 = 1121;
                RebarList.Add(new MRCRebarRecord(1, 0, no, eDB.DB12, 1 * 2, eShapeType.MRC, a1, b, c, d));
                lst1A.Add(a1);
                //double h0 = LenUpper - 32 * 10 + 32 * m;
                //double w = GetXByH(x , y , h0, Radius) ;
                //double wwS = GetX2ByH(xI, yI , h0, Radius)- GetXByH(x, y, h0, Radius);
            }
            int a2 = b;
            int b2 = 32 + 105 * 2;
            ini2B = b2;
            //2#
            RebarList.Add(new MORebarRecord(2, 0, "", eDB.DB12, npts * 2, eShapeType.MO, a2, b2));
            for (int m = 1; m < count; m++)
            {
                string no = "A";
                byte[] array = new byte[1];
                array[0] = (byte)(Convert.ToInt32(64 + m)); //ASCII码强制转换二进制
                no = Convert.ToString(System.Text.Encoding.ASCII.GetString(array));
                int bb2 = (int)(Math.Round((lst1A[m - 1] / ini1A) * ini2B, 0));
                RebarList.Add(new MORebarRecord(2, 0, no, eDB.DB12, 2 * 2, eShapeType.MO, a2, bb2));

            }
            int a3 = (int)((Width - MidWidth) * 0.5) - 50 * 2;
            int b3 = (d / 6) * 2;
            ini3A = a3;
            //3#
            RebarList.Add(new MORebarRecord(3, 0, "", eDB.DB12, npts * 2, eShapeType.MO, a3, b3));
            for (int m = 1; m < count; m++)
            {
                string no = "A";
                byte[] array = new byte[1];
                array[0] = (byte)(Convert.ToInt32(64 + m)); //ASCII码强制转换二进制
                no = Convert.ToString(System.Text.Encoding.ASCII.GetString(array));
                int aa3 = (int)(Math.Round((lst1A[m - 1] / ini1A) * ini3A, 0));
                RebarList.Add(new MORebarRecord(3, 0, no, eDB.DB12, 2 * 2, eShapeType.MO, aa3, b3));

            }

            int h = 155;
            int a4 = (int)((Width - MidWidth) * 0.5) - 50 * 2;
            //4#
            RebarList.Add(new MDRRebarRecord(4, 0, "", eDB.DB12, npts, eShapeType.MDR, a4, h));
            for (int m = 1; m < count; m++)
            {
                string no = "A";
                byte[] array = new byte[1];
                array[0] = (byte)(Convert.ToInt32(64 + m)); //ASCII码强制转换二进制
                no = Convert.ToString(System.Text.Encoding.ASCII.GetString(array));
                int aa4 = (int)(Math.Round((lst1A[m - 1] / ini1A) * a4, 0));
                RebarList.Add(new MDRRebarRecord(4, 0, no, eDB.DB12, 1 * 2, eShapeType.MDR, aa4, h));

            }
            int nptsM = GetLowStirrupNum() * 2;
            RebarList.Add(new MRCRebarRecord(6, 0, "", eDB.DB12, nptsM, eShapeType.MRC, a, b, c, d));

            int a7 = b;
            int b7 = 2 * 210 + 32;
            //7#
            RebarList.Add(new MORebarRecord(7, 0, "", eDB.DB12, nptsM, eShapeType.MO, a7, b7));

            int a8 = Width - 50 * 2; ;
            int b8 = (d / 6) * 2;
            //8#
            RebarList.Add(new MORebarRecord(8, 0, "", eDB.DB12, nptsM, eShapeType.MO, a8, b8));

            RebarList.Add(new MCORebarRecord(8, 1, "", eDB.DB12, 2, eShapeType.MCO, 2407, b8, 927, 189, 183));
            RebarList.Add(new MCORebarRecord(8, 2, "", eDB.DB12, 2, eShapeType.MCO, 2436, b8, 943, 208, 180));
            RebarList.Add(new MCORebarRecord(8, 3, "", eDB.DB12, 2, eShapeType.MCO, 2488, b8, 970, 241, 177));
            int a9 = Length - 150 * 2 - 50 * 2; ;
            int b9 = (MidWidth / 2) + 12;
            //9#
            RebarList.Add(new MORebarRecord(9, 0, "", eDB.DB12, nptsM, eShapeType.MO, a9, b9));

            RebarList.Add(new MCCRebarRecord(9, 1, "", eDB.DB12, 517, b9, 2, eShapeType.MCC));
            RebarList.Add(new MCCRebarRecord(9, 2, "", eDB.DB12, 427, b9, 2, eShapeType.MCC));
            RebarList.Add(new MCCRebarRecord(9, 3, "", eDB.DB12, 337, b9, 2, eShapeType.MCC));
            int a10 = Length - 50 * 2;
            //10#
            RebarList.Add(new MDRRebarRecord(10, 0, "", eDB.DB12, npts, eShapeType.MO, a10, h));
            #endregion

            #region 主筋
            //  1-获取承台尺寸
            FootingBase theFooting = MemberFactory.CreatMember(MemberFactory.FromColumnToFooting(ColumnType), SubType);
            int FTHeight = theFooting.Height;
            int NumMainAll = 4 + 2 + 9 * 2 + 3 * 2 + 6 * 2 + 2 * 2 + 2 * 2;
            #region 9/12m 250搭接
            int Z1 = 8494 - (FTHeight - 160) - 1200; // 搭接节点 1//Z1=8483-(H-160)-1200

            //if (SubType == eSubType.C || SubType == eSubType.D)
            //    Z1 = 11494 - (FTHeight - 160) - 1200;
            #endregion
            //12 中间
            RebarList.Add(new MHXRebarRecord(12, 0, "", MainRebarDB, true, 4, eShapeType.MHX));
            RebarList.Add(new MRLCRebarRecord(12, 0, "B", eDB.DB12, 2, eShapeType.MRLC, 4532, 975, 194, 589));
            //13中间
            RebarList.Add(new MHXRebarRecord(13, 1, "", MainRebarDB, true, 7 * 2, eShapeType.MHX)); //侧
            RebarList.Add(new MHXRebarRecord(13, 2, "", MainRebarDB, true, 3 * 2, eShapeType.MHX)); //上下
            RebarList.Add(new MHXRebarRecord(13, 3, "", MainRebarDB, true, 10 * 2, eShapeType.MHX));   //中间
            RebarList.Add(new MHXRebarRecord(13, 4, "", MainRebarDB, true, 2 * 2, eShapeType.MHX));   //侧角
            RebarList.Add(new MHXRebarRecord(13, 5, "", MainRebarDB, true, 2 * 2, eShapeType.MHX));   //中间角

            //有问题需要处理
            int le =(int)( PierHeight-Z1 - LenUpper + LenUpperL - 32 - 25 - 100-2400-248);
            RebarList.Add(new MHXRebarRecord(13, 1, "*", MainRebarDB, true, 7 * 2, eShapeType.MHX,le)); //侧
            RebarList.Add(new MHXRebarRecord(13, 2, "*", MainRebarDB, true, 3 * 2, eShapeType.MHX, le)); //上下
            RebarList.Add(new MHXRebarRecord(13, 3, "*", MainRebarDB, true, 10 * 2, eShapeType.MHX, le));   //中间
            RebarList.Add(new MHXRebarRecord(13, 4, "*", MainRebarDB, true, 2 * 2, eShapeType.MHX, le));   //侧角
            RebarList.Add(new MHXRebarRecord(13, 5, "*", MainRebarDB, true, 2 * 2, eShapeType.MHX, le));   //中间角


          
            double LConst = PierHeight - LenUpper;
            int[] value = dicRInfo.Values.ToList()[0];
            int arcR = value[0];
            int arcLength = value[1];
            int arcC = value[2];
            int arcNum = value[3];
            int A = 600;        //固定      
            int C = 45;         //固定
            C = 250;
            int D = 2400;       //固定
            int len = 9000;
            int L = len;       //固定
            int r = RebarKnowledge.GerRadius(MainRebarDB);
            int d0 = 32;
            int B = L - A - C - D + r / 2 + d0;
            int aa = (int)Math.Round(LConst + FTHeight - 160 - B - 32, 0, MidpointRounding.AwayFromZero);
            if (C == 250)
                aa = (int)Math.Round(LConst + FTHeight - 160 - B - 248, 0, MidpointRounding.AwayFromZero);
            int bb = arcLength;// (int)Math.Round(arc.Length, 0, MidpointRounding.AwayFromZero);
            int cc = arcC;// 305;
            int dd = 1500 - arcC;// 1195;
            if (MainRebarDB == eDB.DB28)
                dd = 1200 - arcC;
            int rr = arcR;// (int)Math.Round(arc.Radius, 0, MidpointRounding.AwayFromZero);
            foreach (var item in dicRInfo.Keys)
            {
                value = dicRInfo[item];
                int arcr = value[0];
                bb = value[1];
                cc = value[2];
                int arcnum = value[3];
                dd = 1400 - cc;

                rr = arcr;
                string[] va = item.Split('.');

                if (int.Parse(va[0]) == 14)
                    aa = 800;
                if (va.Length == 1)
                    RebarList.Add(new MKRebarRecord(int.Parse(va[0]), 0, "", MainRebarDB, arcnum, eShapeType.MK, aa, bb, cc, dd, rr));
                else if (va.Length == 2)
                    RebarList.Add(new MKRebarRecord(int.Parse(va[0]), int.Parse(va[1]), "", MainRebarDB, arcnum, eShapeType.MK, aa, bb, cc, dd, rr));
                else if (va.Length == 3)
                    RebarList.Add(new MKRebarRecord(int.Parse(va[0]), int.Parse(va[1]), va[2], MainRebarDB, arcnum, eShapeType.MK, aa, bb, cc, dd, rr));

            }

            RebarList.Add(new MANRebarRecord(15, 1, "", MainRebarDB, 1923, 600, 2, eShapeType.MAN));
            RebarList.Add(new MANRebarRecord(15, 2, "", MainRebarDB, 2051, 600, 2, eShapeType.MAN));
            RebarList.Add(new MANRebarRecord(15, 3, "", MainRebarDB, 2179, 600, 2, eShapeType.MAN));
            #endregion
            //if (isDiv)
            //    UAN1N2 = NumMainAll * 8;
            //else
            UAN1N2 = NumMainAll * 4;
        }


    }




}
